#include <vector>
#include <fstream>

double pow_2(double x) {
   return x * x;
}

struct Point {
   double x, y;
   Point() {};
   Point(double x_, double y_): x(x_), y(y_) {};
};

std :: istream& operator>>(std::istream& in, Point& a)
{
   in >> a.x >> a.y;
   return in;
}

double dist(const Point& a, const Point& b)
{
   return pow_2(a.x - b.x) + pow_2(a.y - b.y);
}

Point closest_point(const std::vector<Point>& points, const Point& q) 
{
   Point res = points[0];
   for (int i = 1; i < points.size(); i++) 
   {
      Point curr = points[i];
      if (dist(res, q) > dist(curr, q)) 
         res = curr;
   }
   return res;
}